package com.d2rv.guide;

import com.d2rv.model.GoalModel;
import com.d2rv.offscreen.OffScreen3D;
import processing.core.PVector;

/**
 * This abstract class permits to display different goals in order to guide
 * the user.
 *
 * @author Darrieutort A., Dupouy A., Rossignol L., Van Poucke A.
 */
public abstract class Goal {

    /**
     * 3D Goal model to draw
     */
    protected GoalModel model;

    /**
     * Default constructor.
     *
     * @param model
     */
    public Goal(GoalModel model) {
        this.model = model;
    }

    /**
     * Returns the goal model.
     *
     * @return the goal model
     */
    public GoalModel goalmodel() {
        return this.model;
    }

    /**
     * Abstract method to initialize the goal.
     */
    public abstract void init();

    /**
     * Abstract method to draw the goal.
     *
     * @param parent the current offscreen
     */
    public abstract void draw(OffScreen3D parent);

    /**
     * Abstract method to return the position of the goal.
     *
     * @return the position of the goal
     */
    public abstract PVector position();

    /**
     * Abstract method to set the position of the goal.
     *
     * @param position the new position of the goal
     */
    public abstract void position(PVector position);

    /**
     * Abstract method to draw the goalin the guide offscreen.
     *
     * @param parent the current ofscreen
     * @param userpos the user position
     */
    public abstract void drawGuide(OffScreen3D parent, PVector userpos);

    /**
     * Abstract method to validate the goal.
     */
    public abstract void goalAchieved();
}
